﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Ankou"
    elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>


  <xs:element name="SearchMapping">
    <xs:annotation>
      <xs:documentation>
        The base search configuration element.
      </xs:documentation>
    </xs:annotation>


    <xs:complexType>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element name="document">
          <xs:annotation>
            <xs:documentation>
              A lucene.net document which is made from a class.
            </xs:documentation>
          </xs:annotation>

          <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
              <xs:element name="field">
                <xs:annotation>
                  <xs:documentation>
                    Represents a single field in the lucene.net document.
                  </xs:documentation>
                </xs:annotation>

                <xs:complexType>
                  <xs:attribute name="SortingOptions">
                    <xs:annotation>
                      <xs:documentation>
                        The default sorting options when querying the index.
                      </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="None">
                          <xs:annotation>
                            <xs:documentation>The search results are returned to you by ranking.</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Sort">
                          <xs:annotation>
                            <xs:documentation>This column is sorted when returning search results.</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="SortDescending">
                          <xs:annotation>
                            <xs:documentation>This column is sorted by descending when returning search resutls.</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="IsUniqueKey" type="xs:boolean">
                    <xs:annotation>
                      <xs:documentation>
                        Gets or sets determins if this field is the unique key for the document.
                        Each document should have only a unique key which is used to update and delete values from the full text index.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="name" type="xs:string">
                    <xs:annotation>
                      <xs:documentation>
                        The name of the field that will be stored in the index.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="membername" type="xs:string">
                    <xs:annotation>
                      <xs:documentation>
                        The name of the property or field member in the class, whose value you would like to index.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="boost" type="xs:float">
                    <xs:annotation>
                      <xs:documentation>
                        The boost factor for hits for this field.
                        This value will bemultiplied into the score of all hits on this this field of this
                        document.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="IsDefaultSearchField" type="xs:boolean">
                    <xs:annotation>
                      <xs:documentation>
                        If set, this will be the default field to use when searching. Only one field member should define a default search field per object configuration.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="IndexOptions">
                    <xs:annotation>
                      <xs:documentation>
                        Specifies whether and how a field should be indexed.
                      </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="NotIndexed">
                          <xs:annotation>
                            <xs:documentation>
                              Do not index the field value. This field can thus not be searched,
                              but one can still access its contents provided it has been stored.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Tokenized">
                          <xs:annotation>
                            <xs:documentation>
                              Index the field's value so it can be searched. An Analyzer will be used
                              to tokenize and possibly further normalize the text before its
                              terms will be stored in the index. This is useful for common text.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Untokenized">
                          <xs:annotation>
                            <xs:documentation>
                              Index the field's value without using an Analyzer, so it can be searched.
                              As no analyzer is used the value will be stored as a single term. This is
                              useful for unique Ids like product numbers.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="NotOptimized">
                          <xs:annotation>
                            <xs:documentation>
                              Index the field's value without an Analyzer, and disable
                              the storing of norms.  No norms means that index-time boosting
                              and field length normalization will be disabled.  The benefit is
                              less memory usage as norms take up one byte per indexed field
                              for every document in the index.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="StorageOptions">
                    <xs:annotation>
                      <xs:documentation>
                        Specifies how a field should be stored in the full text index.
                      </xs:documentation>
                    </xs:annotation>
                    
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="NotStored">
                          <xs:annotation>
                            <xs:documentation>
                              Do not store the field value in the index.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>

                        <xs:enumeration value="Stored">
                          <xs:annotation>
                            <xs:documentation>
                              Store the original field value in the index. This is useful for short texts
                              like a document's title which should be displayed with the results. The
                              value is stored in its original form, i.e. no analyzer is used before it is
                              stored.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>

                        <xs:enumeration value="Compressed">
                          <xs:annotation>
                            <xs:documentation>
                              Store the original field value in the index in a compressed form. This is
                              useful for long documents and for binary valued fields.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="TermVectorOptions">
                    <xs:annotation>
                      <xs:documentation>Specifies how a field should have term vectors.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="NotStored">
                          <xs:annotation>
                            <xs:documentation>Do not store term vectors.</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Stored">
                          <xs:annotation>
                            <xs:documentation>
                              Store the term vectors of each document. A term vector is a list
                              of the document's terms and their number of occurences in that document.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="StoreWithPositions">
                          <xs:annotation>
                            <xs:documentation>Store the term vector + token position information</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="StoreWithOffsets">
                          <xs:annotation>
                            <xs:documentation>Store the term vector + Token offset information</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="StoreWithPositionsAndOffsets">
                          <xs:annotation>
                            <xs:documentation>Store the term vector + Token position and offset information</xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>
                    </xs:simpleType>
                    
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            
            <xs:attribute name="class" type="xs:string" />
            
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>


  </xs:element>


</xs:schema>
